Skip to content

crypto: surface OpenSSL errors in X509Certificate.toLegacyObject#63301

Open
fru1tworld wants to merge 1 commit into
nodejs:mainfrom
fru1tworld:crypto-x509-toLegacyObject-errors-63265
Open

crypto: surface OpenSSL errors in X509Certificate.toLegacyObject#63301
fru1tworld wants to merge 1 commit into
nodejs:mainfrom
fru1tworld:crypto-x509-toLegacyObject-errors-63265

Conversation

@fru1tworld
Copy link
Copy Markdown

X509Certificate.toLegacyObject() silently omits the subjectaltname
and infoAccess properties when an internal OpenSSL call fails (e.g.
BIO_new allocation failure), making "extension absent"
indistinguishable from an internal error.

Switch the corresponding ncrypto helpers to MarkPopErrorOnReturn and
throw via ThrowCryptoError when the OpenSSL error queue is non-empty.
An empty queue is still treated as "extension absent" and yields
undefined, preserving existing behavior. The remaining call sites
listed in #63265 are out of scope here.

Refs: #63265

Refs: nodejs#63265
Signed-off-by: fru1tworld <fruitworld.planet@gmail.com>
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. dependencies Pull requests that update a dependency file. needs-ci PRs that need a full CI run. labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. dependencies Pull requests that update a dependency file. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants